<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
		<link rel="stylesheet" href="../../../css/common.css" media="all">
	</head>
	<body>

		<div class="layui-fluid">
			<div class="layui-row" id="title_view"></div>
			<div class="layui-row" id="view"></div>
 		</div>
		<script type="text/html" id="demo">
			<div class="layui-card">
				<div class="layui-card-body">
					<div class="layui-row details">
						<ul class="layui-timeline">
						  {{# for(var i = d.length-1 ; i>=0  ; i--){}}
							 <li class="layui-timeline-item">
							    <i class="layui-icon layui-timeline-axis"></i>
							    <div class="layui-timeline-content layui-text">
							      <h3 class="layui-timeline-title">
							      	{{d[i].datetime}}
							      </h3>
							      <p>
							    	   {{d[i].remark}}
							      </p>
							    </div>
							  </li>
							{{# }}}
						</ul>  
					</div>
				</div>
				
			</div>
		</script>
		<script type="text/html" id="title">
			<div class="layui-card">
				<div class="layui-card-body">
					<div class="layui-row details">
						<div class="layui-col-xs3">
							物流公司 ： <span> {{ d.name ? d.name : ''}}（{{ d.com ? d.com : ''}}）<span> 
						</div>
						<div class="layui-col-xs3">
							 物流单号： <span> {{ d.no? d.no : ''}}<span> 
						</div>
					</div>
				</div>
			</div>
		</script>
		
		<script src="../../../layuiadmin/layui/layui.js"></script>
		<script src="../../../js/jquery.min.js"></script>
		<script src="../../../js/common.js"></script>
		<script>
			var _data = {
				com: getParam('com'),
				no: getParam('no'),
				name:'',
				
			}
			
			 console.log(_data);

			layui.config({
				base: '../../../layuiadmin/' //静态资源所在路径
			}).extend({
				index: 'lib/index' //主入口模块
			}).use(['index', 'form', 'laytpl','table'], function() {
				var $ = layui.$,
					admin = layui.admin,
					laytpl = layui.laytpl,
					table = layui.table,
					form = layui.form;

				initdata();

				function initdata() {
					var orders_sub = []
					$.get(server.query_express_goods, _data, function(res, status) {
						if (status == 'success') {
							if (res.error_code == 0) { 
								var data = res.result
								_data.name = data.company
								var list = data.list
								  
								var getTpl = demo.innerHTML,
									view = document.getElementById('view');
								laytpl(getTpl).render(list, function(html) {
									view.innerHTML = html;
								});
								
								var getTplTitle = title.innerHTML,
									title_ = document.getElementById('title_view');
								laytpl(getTplTitle).render(_data, function(html) {
									title_.innerHTML = html;
								});
								
							} else {
								layer.msg('暂无物流信息');
							}
						} else {
							layer.msg('服务器连接错误');
						}
					});
				}
			});
		</script>
	</body>
</html>
